<?php
/**
 * @Copyright Copyright (C) 2010-2012
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 + Created by:          Webit Solution
 * Company:		Webit Solution
 + Contact:		www.webitsolution.com , developer@webitsolution.com
 * Created on:	Mar 21, 2012
 ^
 + Project: 		WRecruit
 * File Name:	views/employer/view.html.php
 ^ 
 * Description: HTML view class for employer
 ^ 
 * History:		NONE
 ^ 
 */

defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');
jimport('joomla.html.pagination');
require_once 'html/utilities.php';
class WRecruitViewCandidates extends JView
{

	function display($tpl = null)
	{
		global $mainframe, $sorton, $sortorder, $option;
                  
		$user	=& JFactory::getUser();
		$uid=$user->id;
		$viewtype = 'html';
		$type = 'offl';
		$option = 'com_wrecruit';
		$userrole = Array();


		$mainframe = &JFactory::getApplication();
		
	    $version = new JVersion;
	    $joomla = $version->getShortVersion();
		$jversion = substr($joomla,0,3);

		$itemid =  JRequest::getVar('Itemid');
		$document	   =& JFactory::getDocument();
		
		$layout =  JRequest::getVar('layout');
		$model = &$this->getModel();
               
		$page_title = $layout;	
		if ($layout== 'messagelist'){
			$page_title =  ' - Message Listing';
			$box		 = JRequest::getVar('box','candidate_sent');
			$sort = JRequest::getVar('sort','DESC'); 
			$page = JRequest::getVar("page",1);
			$number_show = 5;
			if($page > 1){
				$p	=	$page;
			}
			else{
				$p	=	1;
			}
			$start	=	($p-1)*$number_show;
			$result = $model->messageList($box,$sort, $start, $number_show);
			$this->assignRef('messages',$result);	
		}
		elseif ($layout== 'messagedetail'){
			$page_title =  ' - Message Details';
			$mid	= JRequest::getVar('mid');
			$result = $model->messageDetail($mid);
			$this->assignRef('message',$result);
		}
			$document->setTitle( $page_title);
		//if ($mainframe->getCfg('MetaAuthor') == '1') $mainframe->addMetaTag('author', 'WRecruit 1.6');
		$this->assignRef('userrole', $userrole);
		$this->assignRef('config', $config);
		$this->assignRef('theme', $theme);
		$this->assignRef('option', $option);
		$this->assignRef('params', $params);
		$this->assignRef('viewtype', $viewtype);
		$this->assignRef('employerlinks', $employerlinks);
		$this->assignRef('jobseekerlinks', $jobseekerlinks);
		$this->assignRef('uid', $uid);
		$this->assignRef('id', $id);
		$this->assignRef('Itemid', $itemid);
		$this->assignRef('pdflink', $pdflink);
		$this->assignRef('printlink', $printlink);
		
		$this->assignRef('config', $config);
        parent :: display($tpl);        
	}


}
?>
